package a2022.a20220608;

/**
 * @author lenovo
 * @date 2022/6/8
 */
public class a {
    /**
     * [[1,1],[2,3],[3,2]]
     * [[1,1],[2,2],[3,3]]
     * [[x1,y1],[x2,y2],[x3,y3]]
     * @param p
     * @return
     */
    public boolean isBoomerang(int[][] p) {
        // 1 * (3-2) + 2 * (2-1) + 3 *(1-3)
        // 1 * (2-3) + 2 * (3-1) + 3*(1-2)
        // x1 * ( y2 - y3 ) + x2 * ( y3 - y1 ) + x3 * ( y1 - y2 )
        return (p[0][0] * (p[1][1] - p[2][1]) + p[1][0] * (p[2][1] - p[0][1]) + p[2][0] * (p[0][1] - p[1][1])) != 0;
    }

}
